/**
 * @author Luc Yriarte
 * 
 * Licence : BSD http://www.opensource.org/licenses/bsd-license.php
 *  
 */
package basicSim;

import java.awt.Graphics;
import java.awt.Image;

public class BackBufferedGraphics extends SimView {

	public Image backImage;

	public BackBufferedGraphics(Object3D obj, Image bImage, int w, int h, int f) {
		super(obj,bImage.getGraphics(),w,h,f);
		backImage = bImage;
	}
	
	public void updateModel() {
		model.setDrawMode(drawFacets ? Object3D.DRAW_FACETS : Object3D.DRAW_WIREFRAME);
		model.update(focal, width, height);
		graphics.clearRect(0,0,width,height);
		model.paint(graphics);
	}

	public void updateGraphics() {
		graphics.drawImage(backImage,0,0,null);
	}

	public void updateGraphics(Graphics g) {
		g.drawImage(backImage,0,0,null);
	}

}
